const projectKey = "it_practice_vue3_pc"

const set = (key, value) => {
    key = `${projectKey}_${key}`
    localStorage.setItem(key, JSON.stringify(value))
}

const get = (key) => {
    key = `${projectKey}_${key}`
    let result = ""
    try {
        result = JSON.parse(localStorage.getItem(key))
    } catch (e) {
        console.log(e)
    }
    return result
}

const remove = (key) => {
    key = `${projectKey}_${key}`
    localStorage.removeItem(key)
}

export default {
    set,
    get,
    remove,
}